﻿<Window x:Class="ActivityReader.Controls.Views.LoginView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Login" Width="248" Height="139" WindowStyle="ToolWindow" ResizeMode="NoResize"
        >
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="25"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock Text="User Name:" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"  />
        <TextBox x:Name="UserNameTextBox" Grid.Row="0" Grid.Column="1" Margin="3,3,3,3" Text="{Binding Path=UserName, Mode=TwoWay}"  />

        <TextBlock Text="Password:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" />
        <PasswordBox 
            x:Name="PasswordBox" 
            Grid.Row="1" 
            Grid.Column="1" 
            Margin="3,3,3,3" 
            KeyUp="PasswordBox_KeyUp"   
            />

        <TextBlock Text="Remember Me:" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" />
        <CheckBox x:Name="RememberCredentialsCheckBox" Grid.Row="2" Grid.Column="1" Margin="3,3,3,3" IsChecked="{Binding Path=RememberMe, Mode=TwoWay}" />

        <TextBlock Visibility="{Binding Path=ErrorVisibility, Mode=TwoWay}" x:Name="ErrorTextBlock" Grid.Row="3" Grid.Column="0" Text="{Binding Path=ErrorText}" TextWrapping="Wrap" Foreground="Red" />
        <Button 
            x:Name="OKButton" 
            Content="Login" 
            Command="{Binding Path=LoginCommand}" 
            CommandParameter="{Binding ElementName=PasswordBox}"
            Width="75"
            Height="23" 
            HorizontalAlignment="Right" 
            Grid.Row="3" 
            Grid.Column="1" 
            Margin="3,3,3,3" 
            />
    </Grid>
</Window>
